package com.wenwu.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.wenwu.common.bean.RoleResources;
import com.wenwu.common.bean.RoleResourcesExample;

public interface RoleResourcesMapper extends Dao {
	int countByExample(RoleResourcesExample example);

	int deleteByExample(RoleResourcesExample example);

	int deleteByPrimaryKey(Long roleSourceId);

	int insert(RoleResources record);

	int insertSelective(RoleResources record);

	List<RoleResources> selectByExample(RoleResourcesExample example);

	RoleResources selectByPrimaryKey(Long roleSourceId);

	int updateByExampleSelective(@Param("record") RoleResources record,
			@Param("example") RoleResourcesExample example);

	int updateByExample(@Param("record") RoleResources record,
			@Param("example") RoleResourcesExample example);

	int updateByPrimaryKeySelective(RoleResources record);

	int updateByPrimaryKey(RoleResources record);

	// 先删除原来分配的资源在分配资源
	int deleteBatchByRoleId(Integer roleId) throws SQLException;

	int saveBatch(List<RoleResources> list) throws SQLException;

	List<RoleResources> selectCurrentList(Integer roleId) throws SQLException;

	List<RoleResources> getRoleResourceByRoleid(List<Integer> list)
			throws SQLException;
}